#include "Jordaninclusion.h"
#include<string>
#include<fstream>

int main(int argc, char* argv[])
{
    std::valarray<double> c1x;
    std::valarray<double> c1y;
    std::valarray<double> c2x;
    std::valarray<double> c2y;
    std::valarray<double> c3x;
    std::valarray<double> c3y;
    std::valarray<double> c4x;
    std::valarray<double> c4y;
    std::valarray<double> c5x;
    std::valarray<double> c5y;
    std::valarray<double> c6x;
    std::valarray<double> c6y;
    std::valarray<double> c7x;
    std::valarray<double> c7y;
    std::valarray<double> c8x;
    std::valarray<double> c8y;

    int N;
    std::string tmp;
    std::ifstream curve("newsplinesdata");
    curve >> N;
    std::getline(curve, tmp);
    c1x.resize(N);
    c1y.resize(N);
    for(int i = 0; i < N; i++)
	curve >> c1x[i];
    std::getline(curve, tmp);
    std::getline(curve, tmp);
    for(int i = 0; i < N; i++)
	curve >> c1y[i];
    std::getline(curve, tmp);
    std::getline(curve, tmp);

    curve >> N;
    std::getline(curve, tmp);
    c2x.resize(N);
    c2y.resize(N);
    for(int i = 0; i < N; i++)
	curve >> c2x[i];
    std::getline(curve, tmp);
    std::getline(curve, tmp);
    for(int i = 0; i < N; i++)
	curve >> c2y[i];
    std::getline(curve, tmp);
    std::getline(curve, tmp);

    curve >> N;
    std::getline(curve, tmp);
    c3x.resize(N);
    c3y.resize(N);
    for(int i = 0; i < N; i++)
	curve >> c3x[i];
    std::getline(curve, tmp);
    std::getline(curve, tmp);
    for(int i = 0; i < N; i++)
	curve >> c3y[i];
    std::getline(curve, tmp);
    std::getline(curve, tmp);

    curve >> N;
    std::getline(curve, tmp);
    c4x.resize(N);
    c4y.resize(N);
    for(int i = 0; i < N; i++)
	curve >> c4x[i];
    std::getline(curve, tmp);
    std::getline(curve, tmp);
    for(int i = 0; i < N; i++)
	curve >> c4y[i];
    std::getline(curve, tmp);
    std::getline(curve, tmp);

    curve >> N;
    std::getline(curve, tmp);
    c5x.resize(N);
    c5y.resize(N);
    for(int i = 0; i < N; i++)
	curve >> c5x[i];
    std::getline(curve, tmp);
    std::getline(curve, tmp);
    for(int i = 0; i < N; i++)
	curve >> c5y[i];
    std::getline(curve, tmp);
    std::getline(curve, tmp);

    curve >> N;
    std::getline(curve, tmp);
    c6x.resize(N);
    c6y.resize(N);
    for(int i = 0; i < N; i++)
	curve >> c6x[i];
    std::getline(curve, tmp);
    std::getline(curve, tmp);
    for(int i = 0; i < N; i++)
	curve >> c6y[i];
    std::getline(curve, tmp);
    std::getline(curve, tmp);

    curve >> N;
    std::getline(curve, tmp);
    c7x.resize(N);
    c7y.resize(N);
    for(int i = 0; i < N; i++)
	curve >> c7x[i];
    std::getline(curve, tmp);
    std::getline(curve, tmp);
    for(int i = 0; i < N; i++)
	curve >> c7y[i];
    std::getline(curve, tmp);
    std::getline(curve, tmp);

    curve >> N;
    std::getline(curve, tmp);
    c8x.resize(N);
    c8y.resize(N);
    for(int i = 0; i < N; i++)
	curve >> c8x[i];
    std::getline(curve, tmp);
    std::getline(curve, tmp);
    for(int i = 0; i < N; i++)
	curve >> c8y[i];
    
    Inclusion<double> I(c1x, c1y, c2x, c2y);
    I.inclusion();
    I.resetcurve(c1x, c1y, c3x, c3y);
    I.inclusion();
    I.resetcurve(c1x, c1y, c4x, c4y);
    I.inclusion();
    I.resetcurve(c1x, c1y, c5x, c5y);
    I.inclusion();
    I.resetcurve(c1x, c1y, c6x, c6y);
    I.inclusion();
    I.resetcurve(c1x, c1y, c7x, c7y);
    I.inclusion();
    I.resetcurve(c1x, c1y, c8x, c8y);
    I.inclusion();
    I.resetcurve(c2x, c2y, c3x, c3y);
    I.inclusion();
    I.resetcurve(c2x, c2y, c4x, c4y);
    I.inclusion();
    I.resetcurve(c2x, c2y, c5x, c5y);
    I.inclusion();
    I.resetcurve(c2x, c2y, c6x, c6y);
    I.inclusion();
    I.resetcurve(c2x, c2y, c7x, c7y);
    I.inclusion();
    I.resetcurve(c2x, c2y, c8x, c8y);
    I.inclusion();
    I.resetcurve(c3x, c3y, c4x, c4y);
    I.inclusion();
    I.resetcurve(c3x, c3y, c5x, c5y);
    I.inclusion();
    I.resetcurve(c3x, c3y, c6x, c6y);
    I.inclusion();
    I.resetcurve(c3x, c3y, c7x, c7y);
    I.inclusion();
    I.resetcurve(c3x, c3y, c8x, c8y);
    I.inclusion();
    I.resetcurve(c4x, c4y, c5x, c5y);
    I.inclusion();
    I.resetcurve(c4x, c4y, c6x, c6y);
    I.inclusion();
    I.resetcurve(c4x, c4y, c7x, c7y);
    I.inclusion();
    I.resetcurve(c4x, c4y, c8x, c8y);
    I.inclusion();
    I.resetcurve(c5x, c5y, c6x, c6y);
    I.inclusion();
    I.resetcurve(c5x, c5y, c7x, c7y);
    I.inclusion();
    I.resetcurve(c5x, c5y, c8x, c8y);
    I.inclusion();
    I.resetcurve(c6x, c6y, c7x, c7y);
    I.inclusion();
    I.resetcurve(c6x, c6y, c8x, c8y);
    I.inclusion();
    I.resetcurve(c7x, c7y, c8x, c8y);
    I.inclusion();
    return 0;
};

